package net.hn.hnms.biz.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.hn.hnms.biz.project.domain.ApprovalPerson;
import net.hn.hnms.biz.project.mapper.ApprovalPersonMapper;
import net.hn.hnms.biz.project.request.ApprovePersonReq;
import net.hn.hnms.biz.project.service.ApprovePersonService;
import net.hn.hnms.biz.project.vo.ApproveInfoVo;
import net.hn.hnms.sys.common.mybatis.core.page.PageQuery;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ApprovePersonServiceImpl implements ApprovePersonService {

    @Autowired
    private ApprovalPersonMapper approvalPersonMapper;


    @Override
    public Page<ApproveInfoVo> page(PageQuery page, ApprovePersonReq req) {

        LambdaQueryWrapper<ApprovalPerson> wrapper = new LambdaQueryWrapper<>();
        wrapper.like(StringUtils.isNotBlank(req.getNickName()),ApprovalPerson::getNickName,req.getNickName())
                .like(StringUtils.isNotBlank(req.getUserName()),ApprovalPerson::getUserName,req.getUserName())
                .eq(StringUtils.isNotBlank(req.getPersonType()),ApprovalPerson::getPersonType,req.getPersonType());
        return null;
    }
}
